<?php
namespace App\Api\Jogging\V1;

use PhalApi\Api;
use App\Domain\Jogging\V1\JoggingDomain;
use App\Common\MyApi;

/**
 * 运动V1
 * @author dogstar 20170612
 */

class Jogging extends MyApi {

    public function getRules() {
        return array(
            'index' => array(
                'id' => array('name' => 'id', 'type' => 'int', 'require' => true, 'desc' => '', 'source' => 'get'),
            ),
        );
    }

    /**
     * 运动
     * @desc 运动列表
     * @return int id 新增的ID
     */
    public function index() {
        $res = array();
        $newData = array('id' => $this->id);
        $domain = new JoggingDomain();
        $id = $domain->index($newData);
        /* $res['data'] = array('id' => 1);
        $res['code'] = 1; */
        $res = array('id'=>1, 'name'=>'jiang', 'jogging'=> new \ArrayObject());
        //return $this->output($res);
        return $res;
    }
}
